#pragma once
#include <functional>
#include <string>
#include "frame_common.h"

namespace Media{

typedef enum{
	NONE,
	HDMI,
	USB_TYPEA,
	USB_TYPEC,
    LOCAL_FILE,
	LINE_IN,
	LINE_OUT,
	BLUETOOTH,
    AIRPLAY,
    QUICKSHARE,
	NETWORK,
    DEFAULT
	// SCENCES
}SourceInterfaceEnum;

typedef enum{
	VIDEO,
	AUDIO,
    VA
}SourceMediaType;

typedef enum{
	INPUT,
	OUTPUT
}SourceType;

using frameFuncCb = std::function<void (const FrameCommon::Frame::Ptr&)>;

typedef struct{
    SourceInterfaceEnum m_sourceInterface;
	SourceMediaType m_sourceMediaType;
	SourceType m_sourceType;
    std::string m_sourceContent;
    bool m_isCustomCreated;
}SourceConfig;


class Source{
public:
    Source(SourceInterfaceEnum iEnum, SourceMediaType mType, 
        SourceType sType, std::string content, bool isCustom){
    	m_sourceInterface = iEnum;
        m_sourceMediaType = mType;
        m_sourceType = sType;
        m_isCustomCreated = isCustom;
        m_sourceContent = content;
        m_isRunning = false;
    }
    // virtual ~Source() = 0;
	virtual ~Source()= default;


    SourceConfig GetSourceConfig(){
        return SourceConfig{m_sourceInterface, m_sourceMediaType, m_sourceType, m_sourceContent, m_isCustomCreated};
    }

	SourceInterfaceEnum GetSourceInterfaceEnum(){
    	return m_sourceInterface;
    }

	SourceMediaType GetSourceMediaType(){
    	return m_sourceMediaType;
    }

	SourceType GetSourceType(){
    	return m_sourceType;
    }

    std::string GetSourceContent(){
        return m_sourceContent;
    }

    bool IsCustomCreated() const{
        return m_isCustomCreated;
    }

protected:
    bool isRunning() const{
        return m_isRunning;
    }
    void setRunningState(bool state){
        m_isRunning = state;
    }

private:
    SourceInterfaceEnum m_sourceInterface;
	SourceMediaType m_sourceMediaType;
	SourceType m_sourceType;
    std::string m_sourceContent;
    bool m_isCustomCreated;
    bool m_isRunning;
};
}